from core.basehandler import BaseHandler
from core.room import Room
from core.support import set_cutscene
from core.action import Action

class Sea1(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # build list of actions
        self.add_action(WatchSunset)
        self.add_action(HeadHome)
    
    def get_description(self):
        return "It has been an incredible day at sea. The winds have picked up a little but you're enjoying an amazing sunset and a mojito with just the right amount of mint... life is good! You start the engine back up and plan to return just after dark (in time to close the Sweden business deal). You notice the trade winds shift, some white caps develop to the south and lightning races across the sky. What do you want to do next?  Head home or stick around and watch the sun set?"
        
    def get_image(self):
        return 'sea1_pic.jpg'
    
class Sea1Handler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return Sea1

# define actions for this room


class HeadHome(Action):
    def __init__(self):
        Action.__init__(self, "HeadHome")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Head home"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'sea2lost'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
class WatchSunset(Action):
    def __init__(self):
        Action.__init__(self, "WatchSunset")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Stick around and watch the sunset"
    
    # if treasure is unlocked we go into that room
    # otherwise stay in the basement
    def get_destination(self):
        return 'sea2lost'
 
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
    '''# enabled only if room is lit.
    def is_enabled(self):
        if self.room.is_illuminated():
            return True
        else:
            return False'''